@model EIMS.Models.SupplierTransaction

@{
    ViewData["Title"] = "删除供应商交易记录";
}

<div class="container-fluid">
    <h1 class="mt-4">删除供应商交易记录</h1>
    <ol class="breadcrumb mb-4">
        <li class="breadcrumb-item"><a asp-controller="Home" asp-action="Index">首页</a></li>
        <li class="breadcrumb-item"><a asp-controller="Supplier" asp-action="Index">供应商管理</a></li>
        <li class="breadcrumb-item"><a asp-controller="Supplier" asp-action="Details" asp-route-id="@Model.SupplierId">供应商详情</a></li>
        <li class="breadcrumb-item active">删除交易记录</li>
    </ol>

    <div class="alert alert-danger" role="alert">
        <h4 class="alert-heading"><i class="fas fa-exclamation-triangle"></i> 警告！</h4>
        <p>您确定要删除此交易记录吗？此操作不可逆转。</p>
    </div>

    <div class="card mb-4">
        <div class="card-header">
            <i class="fas fa-money-bill-alt me-1"></i>
            交易记录信息
        </div>
        <div class="card-body">
            <div class="row mb-3">
                <div class="col-sm-3 text-muted">
                    供应商
                </div>
                <div class="col-sm-9">
                    @Html.DisplayFor(model => model.Supplier.Name)
                </div>
            </div>

            <div class="row mb-3">
                <div class="col-sm-3 text-muted">
                    @Html.DisplayNameFor(model => model.TransactionNumber)
                </div>
                <div class="col-sm-9">
                    @Html.DisplayFor(model => model.TransactionNumber)
                </div>
            </div>

            <div class="row mb-3">
                <div class="col-sm-3 text-muted">
                    @Html.DisplayNameFor(model => model.TransactionDate)
                </div>
                <div class="col-sm-9">
                    @Model.TransactionDate.ToString("yyyy-MM-dd")
                </div>
            </div>

            <div class="row mb-3">
                <div class="col-sm-3 text-muted">
                    @Html.DisplayNameFor(model => model.Amount)
                </div>
                <div class="col-sm-9">
                    @Html.DisplayFor(model => model.Amount)
                </div>
            </div>

            <div class="row mb-3">
                <div class="col-sm-3 text-muted">
                    @Html.DisplayNameFor(model => model.TransactionType)
                </div>
                <div class="col-sm-9">
                    @Html.DisplayFor(model => model.TransactionType)
                </div>
            </div>

            <div class="row mb-3">
                <div class="col-sm-3 text-muted">
                    @Html.DisplayNameFor(model => model.PaymentStatus)
                </div>
                <div class="col-sm-9">
                    <span class="badge bg-@(Model.PaymentStatus == EIMS.Models.Enums.PaymentStatus.Paid ? "success" : 
                                        Model.PaymentStatus == EIMS.Models.Enums.PaymentStatus.PartiallyPaid ? "warning" : "danger")">
                        @Html.DisplayFor(model => model.PaymentStatus)
                    </span>
                </div>
            </div>

            <form asp-action="DeleteTransaction">
                <input type="hidden" asp-for="Id" />
                <button type="submit" class="btn btn-danger">
                    <i class="fas fa-trash"></i> 确认删除
                </button>
                <a asp-action="Details" asp-route-id="@Model.SupplierId" class="btn btn-secondary">
                    <i class="fas fa-arrow-left"></i> 返回供应商详情
                </a>
            </form>
        </div>
    </div>
</div> 